/*
 * 医务人员诚信查询
 * @author EX-XIEYUWEN001
 * Filename:    IntegrityMedicalController.java
 * Copyright:   2014 中国平安保险（集团）股份有限公司 版权所有
 * Company:     平安科技养老险及健康险系统开发部
 * Create at:   2014年10月30日
 */
package com.paic.mhis.hcpms.trust.web.controller;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.paic.mhis.core.auth.biz.service.UserDetails;
import com.paic.mhis.hcpms.agreement.healthcareprovider.util.HttpProcessUtil;
import com.paic.mhis.hcpms.trust.biz.service.IntegrityMedicalService;
import com.paic.mhis.hcpms.trust.dto.IntegrityMedicalDTO;
import com.paic.mhis.hcpms.trust.dto.IntegrityMedicalDoctorDTO;
import com.paic.mhis.hcpms.trust.dto.IntegrityMedicalOrgDTO;
import com.paic.mhis.hcpms.trust.intergration.sao.FwaDoctorSao;
import com.paic.mhis.hcpms.trust.web.vo.IntegrityMedicalVO;
import com.paic.pafa.app.biz.service.BusinessServiceException;
import com.paic.pafa.app.integration.sa.PafaSAOException;
import com.paic.pafa.appclient.annotation.BizServicesProxy;
import com.paic.pafa.exceptions.BusinessException;

@Controller
@RequestMapping("/integrityMedical/")
public class IntegrityMedicalController {
	@BizServicesProxy(beanName = "integrityMedicalService")
	private IntegrityMedicalService integrityMedicalService;
	@BizServicesProxy
	private FwaDoctorSao fwaDoctorSao;

	/**
	 * 医务人员诚信查询
	 * 
	 * @param limit
	 * @param start
	 * @param search
	 * @param request
	 * @return
	 * @throws BusinessServiceException
	 * @throws BusinessException
	 */
	@RequestMapping("integrityMedical.do")
	@ResponseBody
	public Map<String, Object> integrityMedical(@RequestParam(value = "limit", defaultValue = "20") int limit,
			@RequestParam(value = "start", defaultValue = "0") int start, @ModelAttribute IntegrityMedicalVO search,
			HttpServletRequest request) throws BusinessServiceException, BusinessException {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		this.paramMap(paramMap, search);
		Map<String, Object> map = new HashMap<String, Object>();
		int count = integrityMedicalService.countIntegrityMedical(paramMap);
		if (count > 0) {
			map.put("integrityMedical",
					integrityMedicalService.findIntegrityMedical(limit, start / limit + 1, paramMap));
			map.put("total", count);
		} else {
			map.put("integrityMedical", null);
			map.put("total", 0);
		}
		return map;
	}

	/**
	 * 明细查询
	 * 
	 * @param search
	 * @param request
	 * @return
	 * @throws BusinessServiceException
	 * @throws BusinessException
	 */
	@RequestMapping("integrityMedicalDesc.do")
	@ResponseBody
	public Map<String, Object> integrityMedicalDesc(@ModelAttribute IntegrityMedicalVO search,
			HttpServletRequest request) throws BusinessServiceException, BusinessException {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		this.paramMapDesc(paramMap, search);
		Map<String, Object> map = new HashMap<String, Object>();
		Map<String, Object> map1 = new HashMap<String, Object>();
		map.put("integrityMedicalDesc", integrityMedicalService.findIntegrityMedicalDesc(paramMap));
		//接口调用
		String startDate = StringUtils.isEmpty(search.getStartDate()) ? null : search.getStartDate();
		String endDate =  StringUtils.isEmpty(search.getEndDate()) ? null : search.getEndDate();
		String doctorCode = StringUtils.isEmpty(search.getCertificateNo()) ? null : search.getCertificateNo();
		try {
			map1 = fwaDoctorSao.invokeDoctorInfoESA(doctorCode, startDate, endDate);
		} catch (PafaSAOException e) {
			e.printStackTrace();
		}
		map.put("map1", map1);
		return map;
	}

	/**
	 * 医务人员审核与审批详情查看
	 * 
	 * @param search
	 * @param request
	 * @return
	 * @throws BusinessServiceException
	 * @throws BusinessException
	 */
	@RequestMapping("integrityAuditAndApproveMedicalDesc.do")
	@ResponseBody
	public Map<String, Object> integrityAuditAndApproveMedicalDesc(@ModelAttribute IntegrityMedicalVO search,
			HttpServletRequest request) throws BusinessServiceException, BusinessException {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		Map<String, Object> map1 = new HashMap<String, Object>();
		this.paramMapDesc(paramMap, search);
		paramMap.put("taskNo", StringUtils.isEmpty(search.getTaskNo()) ? null : search.getTaskNo());
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("integrityMedicalDesc", integrityMedicalService.findIntegrityAuditAndApproveMedicalDesc(paramMap));
		//接口调用
		String startDate = StringUtils.isEmpty(search.getStartDate()) ? null : search.getStartDate();
		String endDate =  StringUtils.isEmpty(search.getEndDate()) ? null : search.getEndDate();
		String doctorCode = StringUtils.isEmpty(search.getCertificateNo()) ? null : search.getCertificateNo();
		try {
			map1 = fwaDoctorSao.invokeDoctorInfoESA(doctorCode, startDate, endDate);
		} catch (PafaSAOException e) {
			e.printStackTrace();
		}
		map.put("map1", map1);
		return map;
	}

	/**
	 * 扣款明细查询
	 * 
	 * @param search
	 * @param request
	 * @return
	 * @throws BusinessServiceException
	 * @throws BusinessException
	 */
	@RequestMapping("integrityMedicalMark.do")
	@ResponseBody
	public Map<String, Object> integrityMedicalMark(@ModelAttribute IntegrityMedicalVO search,
			HttpServletRequest request) throws BusinessServiceException, BusinessException {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		this.paramMapDesc(paramMap, search);
		paramMap.put("orgCode", StringUtils.isEmpty(search.getOrgCode()) ? null : search.getOrgCode());
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("integrityMedicalMark", integrityMedicalService.findIntegrityMedicalMark(paramMap));
		return map;
	}

	/**
	 * 医务人员查询
	 * 
	 * @param search
	 * @param request
	 * @return
	 * @throws BusinessServiceException
	 * @throws BusinessException
	 */
	@RequestMapping("integrityDoctors.do")
	@ResponseBody
	public List<IntegrityMedicalDoctorDTO> integrityDoctors(@ModelAttribute IntegrityMedicalVO search,
			HttpServletRequest request) throws BusinessServiceException, BusinessException {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		// if (StringUtils.isNotEmpty(search.getDoctorName())) {
		paramMap.put("doctorName", StringUtils.isEmpty(search.getDoctorName()) ? null : "%" + search.getDoctorName()
				+ "%");
		paramMap.put("practiceLicense",
				StringUtils.isEmpty(search.getPracticeLicense()) ? null : search.getPracticeLicense());
		paramMap.put("orgCode", StringUtils.isEmpty(search.getOrgCode()) ? null : search.getOrgCode());
		paramMap.put("certificateNo", StringUtils.isEmpty(search.getCertificateNo()) ? null : search.getCertificateNo());
		return integrityMedicalService.findIntegrityDoctor(paramMap);
		// }
		// return null;
	}

	/**
	 * 机构查询
	 * 
	 * @param search
	 * @param request
	 * @return
	 * @throws BusinessServiceException
	 * @throws BusinessException
	 */
	@RequestMapping("integrityOrgs.do")
	@ResponseBody
	public List<IntegrityMedicalOrgDTO> integrityOrgs(@ModelAttribute IntegrityMedicalVO search,
			HttpServletRequest request) throws BusinessServiceException, BusinessException {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("orgName", StringUtils.isEmpty(search.getOrgName()) ? null : "%" + search.getOrgName() + "%");
		return integrityMedicalService.findIntegrityOrg(paramMap);
	}

	/**
	 * 合计查询
	 * 
	 * @param limit
	 * @param start
	 * @param search
	 * @param request
	 * @return
	 * @throws BusinessServiceException
	 * @throws BusinessException
	 */
	@RequestMapping("integrityMedicalTotal.do")
	@ResponseBody
	public Map<String, Object> integrityMedicalTotal(@RequestParam(value = "limit", defaultValue = "20") int limit,
			@RequestParam(value = "start", defaultValue = "0") int start, @ModelAttribute IntegrityMedicalVO search,
			HttpServletRequest request) throws BusinessServiceException, BusinessException {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		this.paramMap(paramMap, search);
		Map<String, Object> map = new HashMap<String, Object>();
		int count = integrityMedicalService.countIntegrityMedicalTotal(paramMap);
		if (count > 0) {
			map.put("integrityMedicalTotal",
					integrityMedicalService.findIntegrityMedicalTotal(limit, start / limit + 1, paramMap));
			map.put("total", count);
		} else {
			map.put("integrityMedicalTotal", null);
			map.put("total", 0);
		}
		return map;
	}

	/**
	 * 人工录入扣分
	 * 
	 * @param request
	 * @return
	 * @throws BusinessException
	 * @throws UnsupportedEncodingException
	 * @throws IOException
	 */
	@RequestMapping(value = "saveIntegrityPoints.do", method = RequestMethod.POST)
	@ResponseBody
	public Map<String, Object> saveIntegrityPoints(HttpServletRequest request) throws BusinessException,
			UnsupportedEncodingException, IOException {
		// 获取参数
		UserDetails user = (UserDetails) request.getSession().getAttribute("user");
		String str = HttpProcessUtil.readRequestBody(request);
		JSONObject transferJson = JSON.parseObject(str);
		Map<String, Object> map = new HashMap<String, Object>();
		boolean isTrue = integrityMedicalService.saveIntegrityPoints(transferJson, user.getUsername());
		if (isTrue) {
			map.put("msg", "保存成功");
		} else {
			map.put("msg", "保存失败");
		}
		return map;
	}

	/**
	 * 医务人员纪录导出
	 * 
	 * @throws BusinessException
	 * */
	@RequestMapping("integrityMedicalReport.do")
	@ResponseBody
	public void integrityMedicalReport(@RequestParam(value = "limit", defaultValue = "20") int limit,
			@RequestParam(value = "start", defaultValue = "0") int start,
			@RequestParam(value = "excelName", defaultValue = "integrityMedical") String excelName,
			@ModelAttribute IntegrityMedicalVO vo, HttpServletResponse response) throws BusinessException {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		this.paramMap(paramMap, vo);
		int total = integrityMedicalService.countIntegrityMedicalReport(paramMap);
		List<IntegrityMedicalDTO> list = new ArrayList<IntegrityMedicalDTO>();
		if (total > 0) {
			limit = 8000;
			for (int i = 0; i < total;) {
				List<IntegrityMedicalDTO> resultListTemp = integrityMedicalService.findIntegrityMedicalReport(limit, i
						/ limit + 1, paramMap);
				list.addAll(resultListTemp);
				i += limit;
			}
		} else {
			list = new ArrayList<IntegrityMedicalDTO>();
		}
		String[] str = { "序号", "医生姓名", "身份证号", "机构名称", "机构编号", "执业时间", "违规记分值", "案件编号", "扣分原因", "案发时间", "暂停医保服务权限时间" };
		try {
			exportExcel(str, excelName, list, response);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public void exportExcel(String[] str, String excelName, List<IntegrityMedicalDTO> list, HttpServletResponse response)
			throws IOException {

		Workbook excel = null;
		try {
			excel = new HSSFWorkbook();
			Sheet sheet = excel.createSheet(excelName);
			Row row = sheet.createRow(0);
			// 设置Excel头
			int j = 0;
			for (String key : str) {
				row.createCell(j).setCellValue(key);
				sheet.setColumnWidth(j, 4000);
				j++;
			}
			// 设置Excel内容
			if (null != list) {
				for (int i = 0; i < list.size(); i++) {
					IntegrityMedicalDTO dto = list.get(i);
					row = sheet.createRow(i + 1);
					row.createCell(0).setCellValue(i + 1);
					row.createCell(1).setCellValue(dto.getName());
					row.createCell(2).setCellValue(dto.getCertificateNo());
					row.createCell(3).setCellValue(dto.getHealthcareProviderName());
					row.createCell(4).setCellValue(dto.getHealthcareProviderCode());
					row.createCell(5).setCellValue(dto.getQualifiedDate());
					row.createCell(6).setCellType(HSSFCell.CELL_TYPE_NUMERIC);
					if(dto.getViolationsScores()!=null&&dto.getViolationsScores()!="")
					{
					row.getCell(6).setCellValue(Double.parseDouble(dto.getViolationsScores()));
					}
					else
					{
						row.getCell(6).setCellValue(Double.parseDouble("0.0"));
					}
					row.createCell(7).setCellValue(dto.getCaseNo());
					row.createCell(8).setCellValue(dto.getReason());
					row.createCell(9).setCellValue(dto.getHappenDate());
					row.createCell(10).setCellValue(dto.getSuspendPayExecutionTime());
				}
			}
			initResponse(response, excelName);
			excel.write(response.getOutputStream());
		} catch (IOException e) {
			// logger.error("导出Excel是发生异常,异常原因:" + e.getMessage());
			e.printStackTrace();
		} finally {
			response.getOutputStream().flush();
			response.getOutputStream().close();
		}
	}

	/**
	 * 医务人员纪录-明细导出
	 * 
	 * @throws BusinessException
	 * */
	@RequestMapping("integrityMedicalDescReport.do")
	@ResponseBody
	public void integrityMedicalDescReport(
			@RequestParam(value = "excelName", defaultValue = "integrityMedicalDesc") String excelName,
			@ModelAttribute IntegrityMedicalVO vo, HttpServletResponse response) throws BusinessException {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		this.paramMapDesc(paramMap, vo);
		List<IntegrityMedicalDTO> resultListTemp = integrityMedicalService.findIntegrityMedicalDesc(paramMap);
		if (resultListTemp.size() <= 0) {
			resultListTemp = new ArrayList<IntegrityMedicalDTO>();
		}
		// "医生姓名", "身份证号",
		String[] str = { "机构编号", "机构地址", "执业时间", "违规记分值", "违规记分明细", "备注" };
		try {
			exportDescExcel(str, excelName, resultListTemp, response);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public void exportDescExcel(String[] str, String excelName, List<IntegrityMedicalDTO> list,
			HttpServletResponse response) throws IOException {

		Workbook excel = null;
		try {
			excel = new HSSFWorkbook();
			Sheet sheet = excel.createSheet(excelName);
			Row row = sheet.createRow(0);
			// 设置Excel头
			int j = 0;
			for (String key : str) {
				row.createCell(j).setCellValue(key);
				sheet.setColumnWidth(j, 4000);
				j++;
			}
			// 设置Excel内容
			if (null != list) {
				for (int i = 0; i < list.size(); i++) {
					IntegrityMedicalDTO dto = list.get(i);
					row = sheet.createRow(i + 1);
					// row.createCell(0).setCellValue(dto.getName());
					// row.createCell(1).setCellValue(dto.getCertificateNo());
					row.createCell(0).setCellValue(dto.getHealthcareProviderCode());
					row.createCell(1).setCellValue(dto.getFullAddress());
					row.createCell(2).setCellValue(dto.getQualifiedDate());
					row.createCell(3).setCellValue(dto.getViolationsScores());
					row.createCell(4).setCellValue("查询明细");
					row.createCell(5).setCellValue("");
				}
			}
			initResponse(response, excelName);
			excel.write(response.getOutputStream());
		} catch (IOException e) {
			// logger.error("导出Excel是发生异常,异常原因:" + e.getMessage());
			e.printStackTrace();
		} finally {
			response.getOutputStream().flush();
			response.getOutputStream().close();
		}
	}

	/**
	 * 医务人员纪录-扣分明细导出
	 * 
	 * @throws BusinessException
	 * */
	@RequestMapping("integrityMedicalMarkReport.do")
	@ResponseBody
	public void integrityMedicalMarkReport(
			@RequestParam(value = "excelName", defaultValue = "integrityMedicalMark") String excelName,
			@ModelAttribute IntegrityMedicalVO vo, HttpServletResponse response) throws BusinessException {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		this.paramMapDesc(paramMap, vo);
		paramMap.put("orgCode", StringUtils.isEmpty(vo.getOrgCode()) ? null : vo.getOrgCode());
		List<IntegrityMedicalDTO> resultListTemp = integrityMedicalService.findIntegrityMedicalMark(paramMap);
		if (resultListTemp.size() <= 0) {
			resultListTemp = new ArrayList<IntegrityMedicalDTO>();
		}
		String[] str = { "序号", "案件号", "机构名称", "机构地址", "违规记分值", "扣分原因", "案发日期", "暂停医保服务权限时间", "备注" };
		try {
			exportMarkExcel(str, excelName, resultListTemp, response);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public void exportMarkExcel(String[] str, String excelName, List<IntegrityMedicalDTO> list,
			HttpServletResponse response) throws IOException {
		Workbook excel = null;
		try {
			excel = new HSSFWorkbook();
			Sheet sheet = excel.createSheet(excelName);
			Row row = sheet.createRow(0);
			// 设置Excel头
			int j = 0;
			for (String key : str) {
				row.createCell(j).setCellValue(key);
				sheet.setColumnWidth(j, 4000);
				j++;
			}
			// 设置Excel内容
			if (null != list) {
				for (int i = 0; i < list.size(); i++) {
					IntegrityMedicalDTO dto = list.get(i);
					row = sheet.createRow(i + 1);
					row.createCell(0).setCellValue(i + 1);
					row.createCell(1).setCellValue(dto.getCaseNo());
					row.createCell(2).setCellValue(dto.getHealthcareProviderName());
					row.createCell(3).setCellValue(dto.getFullAddress());
					row.createCell(4).setCellValue(dto.getViolationsScores());
					row.createCell(5).setCellValue(dto.getReason());
					row.createCell(6).setCellValue(dto.getHappenDate());
					row.createCell(7).setCellValue(dto.getSuspendPayExecutionTime());
					row.createCell(8).setCellValue("");
				}
			}
			initResponse(response, excelName);
			excel.write(response.getOutputStream());
		} catch (IOException e) {
			// logger.error("导出Excel是发生异常,异常原因:" + e.getMessage());
			e.printStackTrace();
		} finally {
			response.getOutputStream().flush();
			response.getOutputStream().close();
		}
	}

	/**
	 * 医务人员纪录-合计明细导出
	 * 
	 * @throws BusinessException
	 * */
	@RequestMapping("integrityMedicalTotalReport.do")
	@ResponseBody
	public void integrityMedicalTotalReport(@RequestParam(value = "limit", defaultValue = "20") int limit,
			@RequestParam(value = "start", defaultValue = "0") int start,
			@RequestParam(value = "excelName", defaultValue = "integrityMedicalDesc") String excelName,
			@ModelAttribute IntegrityMedicalVO vo, HttpServletResponse response) throws BusinessException {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		this.paramMap(paramMap, vo);
		int total = integrityMedicalService.countIntegrityMedicalTotal(paramMap);
		List<IntegrityMedicalDTO> list = new ArrayList<IntegrityMedicalDTO>();
		if (total > 0) {
			limit = 8000;
			for (int i = 0; i < total;) {
				List<IntegrityMedicalDTO> resultListTemp = integrityMedicalService.findIntegrityMedicalTotal(limit, i
						/ limit + 1, paramMap);
				list.addAll(resultListTemp);
				i += limit;
			}
		} else {
			list = new ArrayList<IntegrityMedicalDTO>();
		}
		String[] str = { "医生姓名", "身份证号", "机构编号", "机构地址", "执业时间", "违规记分值", "违规记分明细", "备注" };
		try {
			exportTotalExcel(str, excelName, list, response);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public void exportTotalExcel(String[] str, String excelName, List<IntegrityMedicalDTO> list,
			HttpServletResponse response) throws IOException {

		Workbook excel = null;
		try {
			excel = new HSSFWorkbook();
			Sheet sheet = excel.createSheet(excelName);
			Row row = sheet.createRow(0);
			// 设置Excel头
			int j = 0;
			for (String key : str) {
				row.createCell(j).setCellValue(key);
				sheet.setColumnWidth(j, 4000);
				j++;
			}
			// 设置Excel内容
			if (null != list) {
				for (int i = 0; i < list.size(); i++) {
					IntegrityMedicalDTO dto = list.get(i);
					row = sheet.createRow(i + 1);
					row.createCell(0).setCellValue(dto.getName());
					row.createCell(1).setCellValue(dto.getCertificateNo());
					row.createCell(2).setCellValue(dto.getHealthcareProviderCode());
					row.createCell(3).setCellValue(dto.getFullAddress());
					row.createCell(4).setCellValue(dto.getQualifiedDate());
					row.createCell(5).setCellValue(dto.getViolationsScores());
					row.createCell(6).setCellValue("查询明细");
					row.createCell(7).setCellValue("");
				}
			}
			initResponse(response, excelName);
			excel.write(response.getOutputStream());
		} catch (IOException e) {
			// logger.error("导出Excel是发生异常,异常原因:" + e.getMessage());
			e.printStackTrace();
		} finally {
			response.getOutputStream().flush();
			response.getOutputStream().close();
		}
	}

	private void initResponse(HttpServletResponse response, String name) {
		try {
			response.addHeader("Pragma", "no-cache");
			response.addHeader("Cache-Control", "no-cache");
			response.reset();
			response.setContentType("APPLICATION/OCTET-STREAM");
			String fileName = new String((name).getBytes("utf-8"), "ISO8859-1") + ".xls";
			response.setHeader("content-disposition", "attachment;fileName=\"" + fileName + "\"");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
	}

	private void paramMapDesc(Map<String, Object> paramMap, IntegrityMedicalVO search) {
		paramMap.put("startDate", StringUtils.isEmpty(search.getStartDate()) ? null : search.getStartDate());
		paramMap.put("endDate", StringUtils.isEmpty(search.getEndDate()) ? null : search.getEndDate());
		paramMap.put("doctorCode", StringUtils.isEmpty(search.getDoctorCode()) ? null : search.getDoctorCode());
	}

	private void paramMap(Map<String, Object> paramMap, IntegrityMedicalVO search) {
		paramMap.put("startDate", StringUtils.isEmpty(search.getStartDate()) ? null : search.getStartDate());
		paramMap.put("endDate", StringUtils.isEmpty(search.getEndDate()) ? null : search.getEndDate());
		if (StringUtils.isNotEmpty(search.getDoctorCode())) {
			String[] paramStr = search.getDoctorCode().split("\\；\\s*|;\\s*|,\\s*|，\\s*");
			paramMap.put("doctorCode", paramStr);
		} else {
			paramMap.put("doctorCode", null);
		}
		if (StringUtils.isNotEmpty(search.getOrgCode())) {
			String[] paramStr = search.getOrgCode().split("\\；\\s*|;\\s*|,\\s*|，\\s*");
			paramMap.put("orgCode", paramStr);
		} else {
			paramMap.put("orgCode", null);
		}
	}
}
